package com.qbw.core.observable;

import androidx.databinding.BaseObservable;
import androidx.databinding.Bindable;

import com.qbw.app.BR;


/**
 * @author qinbaowei
 * @date 2017/8/16
 * @email qbaowei@qq.com
 */

public class ObservableInt extends BaseObservable {
    private int mValue;

    public ObservableInt() {
    }

    public ObservableInt(int value) {
        mValue = value;
    }

    @Bindable
    public int getValue() {
        return mValue;
    }

    public void setValue(int value) {
        if (mValue == value) {
            return;
        }
        mValue = value;
        notifyPropertyChanged(BR.value);
    }

    public void setValueWithoutNotify(int value) {
        if (mValue == value) {
            return;
        }
        mValue = value;
    }
}
